/*
 * Copyright (c) 2017年11月02日  by XuanWu Wireless Technology Co., Ltd 
 *             All rights reserved  
 */
package com.zml.service;

import com.zml.dao.BizDataDao;
import com.zml.entity.ConfigRecord;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author <a href="mailto:zhaominglin@wxchina.com">minglin.Zhao</a>
 * @Description
 * @Date 2017/11/2
 * @Version 1.0.0
 */
@Service
public class BizDataService {
    @Autowired
    private BizDataDao bizDataDao;

    public List<ConfigRecord> findAllConfigs() {
        return bizDataDao.findAllConfigs();
    }

    public void updateConfig(ConfigRecord config) {
        bizDataDao.updateConfig(config);
    }

    public boolean updateConfigWithOldValue(ConfigRecord config, String oldValue) {
        int result = bizDataDao.updateConfigWithOldValue(config, oldValue);
        if (result > 0) {
            return true;
        }
        return false;
    }
}
